package com.proj.springbootdemo.dao.model.gen;

import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author liujia
 */
@ToString
@NoArgsConstructor
public class Books implements Serializable {
    private static final long serialVersionUID = -6628477739900762958L;

    private Integer id;

    private String bookname;

    private Integer publisherid;

    private Books(Builder builder) {
        setId(builder.id);
        setBookname(builder.bookname);
        setPublisherid(builder.publisherid);
    }

    public static Builder builder() {
        return new Builder();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBookname() {
        return bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname == null ? null : bookname.trim();
    }

    public Integer getPublisherid() {
        return publisherid;
    }

    public void setPublisherid(Integer publisherid) {
        this.publisherid = publisherid;
    }


    public static final class Builder {
        private Integer id;
        private String bookname;
        private Integer publisherid;

        private Builder() {
        }

        public Builder id(Integer val) {
            id = val;
            return this;
        }

        public Builder bookname(String val) {
            bookname = val;
            return this;
        }

        public Builder publisherid(Integer val) {
            publisherid = val;
            return this;
        }

        public Books build() {
            return new Books(this);
        }
    }
}